package org.shj.pattern.strategy

class Context{
  var strategy: Strategy = _
  
  def shouldPay(total: Double): Double = {
    strategy.getResult(total)
  }
}

object Context{
  def apply(stype: String): Context = {
    val ctx = new Context
    ctx.strategy = StrategyFactory.getStrategy(stype)
    ctx
  }
}